<!--
 * @Author: your name
 * @Date: 2021-09-30 10:11:06
 * @LastEditTime: 2021-09-30 10:49:46
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \smartCampus-admin\src\plugins\components\popButton\index.vue
-->
// 气泡确认button // @ok 点击确认 // @off 点击取消
<template>
    <div class="sc-pop-button">
        <el-popconfirm
            @confirm="$emit('ok', 1)"
            @cancel="$emit('off')"
            :confirm-button-text="confirmButtonText"
            :cancel-button-text="cancelButtonText"
            :icon="icon"
            icon-color="red"
            :title="title"
        >
            <el-button :style="customStyle" :type="type" :icon="btnIcon" :size="size" slot="reference">
                <slot></slot>
            </el-button>
        </el-popconfirm>
    </div>
</template>

<script>
import config from "../../config";

export default {
    name: config.prefix + "PopButton",
    props: {
        customStyle: {
            type: Object,
            default() {
                return {};
            },
        },
        type: {
            type: String,
            default: "text",
        },
        size: {
            type: String,
            default: "medium", //medium / small / mini
        },
        btnIcon: "",
        title: {
            type: String,
            default: "确定删除吗？",
        },
        confirmButtonText: {
            type: String,
            default: "确认",
        },
        cancelButtonText: {
            type: String,
            default: "取消",
        },
        icon: {
            type: String,
            default: "el-icon-info",
        },
    },
    data() {
        return {};
    },
};
</script>
<style lang="scss" scoped>
.sc-pop-button {
    margin: 0 10px;
    display: inline-block;
}
</style>
